package org.zxw.openFeign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.zxw.pojo.entity.TrainingPlan;

import java.util.List;

@FeignClient(name = "training-service")
public interface TrainingPlanClient {
    /**
     * 基础推荐接口
     * @param goal
     * @param limit
     * @return
     */
    @GetMapping("/api/v1/training/foundation")
    public ResponseEntity<List<TrainingPlan>> recommendPlan(
            @RequestParam String goal,
            @RequestParam(defaultValue = "3") int limit);

    /**
     * 高级推荐接口
     * @param goal
     * @param difficulty
     * @param limit
     * @return
     */
    @GetMapping("/api/v1/training/advanced")
    public ResponseEntity<List<TrainingPlan>> recommendPlanAdvanced(
            @RequestParam String goal,
            @RequestParam String difficulty,
            @RequestParam(defaultValue = "3") int limit);

    /**
     * 智能推荐接口 -根据BMI和难度
     * @param height
     * @param weight
     * @param difficulty
     * @param limit
     * @return
     */
    @GetMapping("/api/v1/training/smart")
    public ResponseEntity<List<TrainingPlan>> recommendPlanSmart(
            @RequestParam double height, // 单位:米
            @RequestParam double weight, // 单位:千克
            @RequestParam(defaultValue = "中级") String difficulty,
            @RequestParam(defaultValue = "3") int limit);
}
